package com.x.Part12_Object.equalsApply;

import java.util.Objects;

/**
 * ClassName: Customer
 * Package: IntelliJ IDEA
 * Description:
 * Written by HanXu
 * Create 2024.02.29 21:01
 */
public class Customer {
    private String id;
    private String name;
    private Account acct;

    public Customer() {
    }

    public Customer(String id, String name, Account acct) {
        this.id = id;
        this.name = name;
        this.acct = acct;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Account getAcct() {
        return acct;
    }

    public void setAcct(Account acct) {
        this.acct = acct;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Customer customer = (Customer) o;

        if (!Objects.equals(id, customer.id)) return false;
        if (!Objects.equals(name, customer.name)) return false;
        return Objects.equals(acct, customer.acct);
    }


}
